package cglgu.trellis.chado.das2.modelimpl.cglgu;

/*
 * $Id: ChadoType.java 191 2011-03-27 00:38:22Z sundaram.georgetown@gmail.com $
 * $Author: sundaram.georgetown@gmail.com $
 * $Date: 2011-03-27 00:38:22 +0000 (Sun, 27 Mar 2011) $
 * $Rev: 191 $
 * $HeadURL: http://genomancer.googlecode.com/svn/branches/gu-dev-branch/tengcha/src/cglgu/trellis/chado/das2/modelimpl/cglgu/ChadoType.java $
 */

import genomancer.trellis.das2.model.Das2TypeI;
import cglgu.trellis.chado.das2.TrackType;
import genomancer.vine.das2.client.modelimpl.Das2Type;
import cglgu.trellis.chado.das2.modelimpl.ChadoType;
import java.net.URI;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class ChadoType extends cglgu.trellis.chado.das2.modelimpl.ChadoType {

	boolean initialized = false;

	ChadoVersion chado_version;

	public ChadoType(URI base_uri, ChadoVersion version,  ResultSet rs) {

		String program = rs.getString(0); // index should be static final in TableColumnLookup
		String description = rs.getString(1); // index should be static final in TableColumnLookup


		super(base_uri,      // base_uri
				program,  	 // local_uri_string
				program, 	 // title
				description, // description
				null,        // info_url
				null,        // ontology_term_name (will get assigned ROOT_TYPE if null)
				null,        // method
				true);       // is_searchable

		chado_version = version;

		// do substitutions to get proper title
		// handling title here, to use grouping info
		String short_title = program;

		short_title = short_title.replace('/', ':');
		String fixed_title = short_title;

		this.setTitle(fixed_title);

		// handling description here
		this.setDescription(description);

		setTrackTableType(program);
	}
}